home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-in_the_mag-
/
basics
/
amos
/
a3dsimple-sim.lha
/
README
< prev
next >
Wrap
Text File
|
1998-07-28
|
19KB
|
422 lines
A simple 3D flight simulator.
(using amos 3d)
Author: David Lawrence.
=====================================
This is a hasty upload as the author is about to be cut off from the
internet (due to not having amiga stuff to handle provider's system changes).
This program runs ok , but there's no time to balance up the values, level
control, tidy up etc. so as to turn it into a decent game.
SKIP to the bottom of this file under the heading ' THIS PROGRAM', for
controls not mentioned on game screen and which may help adjust things, ...
.. and to get the game scenario..
If you want to change the landscape of this sim. you will need to download
the A3Dscape program which is to follow to aminet if possible..
======================================
This archive is put here so that some people might get a bit of fun from
this experiment, and so other amos programmers can freely use,
modify, improve on, (or just have a good laugh at ) one persons attempt
to overcome rotation limits in amos 3d. This flight sim shows every flaw
and limit of amos 3d! .. it's not entirely my fault that it's like this!!
It is quite possible that after running this your other programs will
crash.
On A1200 with fast ram and 28 mhz cpu it will average about 12 f.p.s.
There is a crude time limit to prevent very fast machines from producing
uncontrollable action. A standard A1200 will produce a SLOOW motion effect.
Should run on Pal and nstc.
The archive includes:-
- a compiled workbench version for non-amos users
- amos source code - needs voodoo 3d extension to edit and run.
- the necessary sample bank, screens, 3d objects
- ( note- the 3d library is a required part of the compiled version, as
per the 3d manual,.. it's not an amos extension.
Also, the 3d extension referred to herein is
the 'voodoo' 3d extn, not 'stars' or other)
The program expects all the above archive to be extracted ( contents
and sub-directories) into one main directory.. (any name)
To contact author try posting to
D. Lawrence
Rock Road
R.D.7
Pahiatua
New Zealand
......................
==============================
Some stuff from previous upload for anyone interested.
If anyone wants to obtain amos 3d I have no suggestions that are legal.
You could try annoying Europress?.
Though it sounds like maybe someone else has the rights to the 3d code and
object modeller.
But in mid 1995 I wrote many pages of criticism of amos 3d
to them, and received back an offer to replace the object modeller with
the latest version if I sent the original discs back.
Since that was hardly the response I wanted I did nothing, but it means
that they could supply original stuff at that point. Their letter in reply
was actually quite reasonable... .
It was on a mag. disk some years ago, you may find a friend who has a copy.
There must be thousands around somewhere. Maybe amos mail list people
could mount a campaign to get all unused copies into a 'pool'... err ..is it
legal to buy and sell (or give) such original mag discs???. with the mag?
Or since they must know that such disks will have been freely copied and
spread, are they really worried one way or the other??
The object modeller though, really needs the manual to sort out the use.
And note the mag. version is for amos 1.35 and apparently will crash
amos pro if you try to run it as an extension. The 3d for Amos Pro was
on an extras disk I hear, for that program.
As an alternative :-
It should be possible to use AMCAF vector rotations for Amos pro to make a
3d program. I think that's what I might try now if starting again.
And you could make use of full colours etc. And make a better object modeller.
.....at least as long as you kept it all simple.
You would need some simple trig. for putting the amcaf rotations
to use in a '3d world' , or someone can produce a master set of
amos code routines, totally optimised....yes?
But it would be a LOT OF WORK,and probably need some assembler routines
if you wanted to handle large numbers of co-ords. Or to check for surfaces
and lines that are both in front of and behind the viewpoint, as in a
full 3d system..
........ ....................
.............................
Feel free to use anything here for your own programs. Or to upgrade the
whole thing, I have spent too much time worrying to optimise properly.
There may well be some other way to improve A3d .. go to it.
(and let me know how please..)
Those with the Amos pro version, and a fast machine, may be able to
use the amcaf blitter commands to copy bit planes (with masking) and
extend the A3d colour range.
I believe that really, a complete new, and faster 3d system- using fast ram
(bit planes or chunky) and cpu drawing techniques is what is needed for amos.
It may be possible to do quite a lot with the amcaf vector rotation
commands. But then, one needs a polygon command which doesn't crash
the machine when off screen right somewhere!
..... food for Thought....
No one else seems to think so, but I believe (from a position of moderate
ignorance) that on the A1200, the use of bit planes in FAST ram could
be turned to advantage by drawing (triangular) polygons completely with
pre selectable horizontal lines....(from table of 'slope')
Hence storing large areas with few ' Moves'. (Then blasting to chip ram
quickly for dislay when finished.)
The advantage of 'chunky' is the ease of finding a pixel address, but this
may not count against the possibility above..after all, you would only need
to find the 3 points of the triangle this way. (and they could use a 'table
referencing' approach anyway).
No need for - 'lines first' and then 'filling' afterwards.
Has anyone actually tried such a system? or is it impossible?
It strikes me, from my old 6502 code programming attempts, as a relatively
simple thing to be done . Just one optimised routine which would transform
the output of the amiga for polygon 3d..
Pity I don't want to get familiar with 68000 code... (lazy sod)
I would like to know the outcome speed wise. Years ago a mag disk had a
'VR world' prog which could be switched between blitter, rom routines,
or cpu code for a polygon style. The last was fastest and I don't think it
was even drawing in fast ram... just direct to chip.
Some people are doing routines with cpu and blitter. This sounds a good
idea, except that you are not using the cpu in a fast ram screen where it
really moves.
Or maybe everyone else prefers the doom/corridor style with chunky style
screen and texture mapping. OK, whatever.. Go to it.
I just hope someone might come up with something before the Amiga expiry
date passes.
Or my expiry date!!
Also... sorry to have not got this stuff out much earlier when amos and 3d
were still officially around, and this might have been of some use.
But I was isolated in a bit of a personal black hole, and the internet
was not on my event horizon at all. And is likely now to disappear again!
Good luck all.
David L.
...............................................
...............................................
ABOUT AMOS 3D, and rotations, as applied to this program.
(nearly a repeat of previous uploads but with application to flight sim.)
( skip to heading THIS PROGRAM if not interested)
This writer was depressed to discover that amos3d is not ideal.
It is quite fast for a blitter system, and I find the commands fit my
way of thinking .
BUT... problems include...
There are very restricted colour choices, it can write over screen
edges and crash from (seemingly) memory problems, and since it uses
masking to draw objects ( probably to gain speed), it is incompatible
with other drawing operations. Also the screen conversion doesn't handle
off screen positions. All these problems are very in evidence in
trying to make a flight sim!
And the object modeller though it has some good ideas, drives me completely
up the wall.
Hence the minimal objects in programs I have made).
But above all, the rotation angles are limited, and do not match the
manual which implies the ability to rotate objects and viewpoint about
their own axes with simple commands..
In fact the z rotation axis of objects and viewpoint remain
permanently aligned with the z axis of the co-ord world.
It did not have to be that way as the amcaf vector rotations for example
seem to rotate relative to their current alignment.. using matrix maths.
It may be possible to use complex sin* cos formula to make amos3d
work that way, but all my attempts failed at the angle extremes..
(My '3dtests' dir is full of things like;- 3dcalc, novertcalc, nearlythere,
frontworks, .... very depressing. And I can't even understand them now)
-------------------
The partial solution used here and in my other programs, is to change the
normal point of view and hence the apparent way the objects rotate.
It's as simple as setting the initial view angle at rt. angles to normal
on the A angle axis .
And then being sure you put your objects in the new world ground plane
of X, Y co-ords (instead of x,z as normal) with their A angles also moved
one rt angle...
It may be clearest to visualize as follows;-
Imagine you have stuck your head into the co-ord world through your monitor
and are looking straight down. Now twist your head to look to your right.
The effect from your point of view, is that the world z axis now seems
vertical ( i.e. off the top of your head ) while the x goes away
into the distance ahead and the y goes from side to side.
Your ground objects are put on the new ground plane,( which from the old
point of view was the plane parallel to, or 'made by' the monitor screen )
For convenience I chose start angles which gave positive z upwards,
positive x away into distance, y positive to the right, but the x,y
(set by initial angle c ) could be any chosen direction.
The main thing is that while the z axis rotations still remain aligned
with the 'world' z axis, this is no longer the longitudinal Z axis of the
objects and viewpoint... from your new point of view.
--------------
It is possible now to point an object in any world direction on the
z axis (angle c), elevate with angle B, and roll any angle with A.
I'll call this;- mode3
The limits of this are:-
1. The object can not use td forward, since the rolling angle A
is not the axis used by td forward.
Instead you have to use a sin/cos formula to move.
( see source code A3Dmodelsim))
2. since the viewpoint cannot align along the A angle/ axis
the VIEWPOINT cannot be flown about as in a proper flight sim.
3. A seperate 'yaw' response is too difficult to arrange.
None the less it is possible to fly an object around properly if
it is saved from the object modeller at right angles (pointed left) to the
normal angle. (if you used td forward it would go sideways)
This is the mode used by the previous 'A3Dmodelsim'. It was very tricky
to understand how to adjust the rotation angles as the object pointed
upwards in the world.. because the roll angle (A) gradually becomes a change
in the direction in the world. (angle C )
It's in the source code for that prog. but if anyone needs more I could
supply notes.. once I've re- worked it out myself! (Don't think this was
worked out by some blinding quick brain. It mostly happened by hours of
experiment over many months, and step by step advance. NOW it seems simple)
..............................
It is possible though, to use td foward for objects and viewpoint
with the world in this orientation, if you use angle B for rolling and A
for elevation. Angle C still sets world direction.
Call this mode 2
The limits of this mode are:-
1. the B rolling axis is always parallel to the 'ground' plane.
(Though you can point it in any direction on that plane.)
Therefore when you elevate with angle A and try to roll with B, the object
or view 'skews' or 'barrel rolls' it's nose around in an arc.
The greater the elevation the greater the skew.
It is possible to use a simple sin (or cos?, I forget) to reverse the
skew in the inverted part of the roll.
This is just enough to make it useable as a limited flight
sim with a proper travelling viewpoint but held within limits up and down.
----------------------------------
THIS PROGRAM
===================================
Since the above was written the rotation process has been changed for
better control. The roll angle was limited, and it became
possible to increase the down/up limits and get also a compensation
that enabled the view to point and roll almost exactly as
in 'proper' flight sim. Look at the 'adjustview' part of prog. to see
how each angle change gets an input from other angles to keep the view
pointed in the right direction.
It would be also possible to get a loop capability, but would need work
to move the "sky" object correctly and to have an automatic return to
upright at the top of the loop if one didn't continue looping back to
level flight.
Amos programmers may be interested in the way the landscape is sorted out.
Data is set onto a 40,40 grid. As the view moves about, a projection ahead
selects a central grid square at a variable distance ahead depending on
altitude (but not vertical attitude). Every time this point moves by
equivalent of one grid square, all ground objects are "killed" and a new set
of objects ( 1 per grid square) invoked.
Not ideal, since re- invoking is slow but it's tricky to sort out which
objects can be retained for the next selection.
The area covered is limited to a square surrounding the centre plus
a selection from more distant grids... if roads or water etc.
Not the best, but there is no way with amos3d of drawing distance
polygons for large areas of land or of using lines for roads.
=== Extra controls on program ====
As said this is a rush job.
To compensate, there is ability to change the
time interval between re-appearances of the enemy aircraft which, while
the plane is over the operations area, causes "damage".
Use key M for more time, N to reduce. The figure will be printed on the
cockpit frame.
Also there is a cheat on key 4
This will put the enemy plane right in front of you.
..... GAME SCENARIO ......
It is suddenly discovered that enemy underground elements have been secretly
constructing masts which guide in high speed enemy jet bombers.
Whenever the bomber is over the territory the damage indicator, on bottom
left of HUD area goes red, and counts up. 100%-- you lose..
Your weapon is a proximity missile... which you have to aim with a feel for
it's 3d position, as it's unguided. (on fire button)
The targets appear on the main map and on the relative map 3.
(Map 3 can be zoomed with Z or shrunk with X.)
If you can wipe out all the masts you win.
But as you get the masts the underground repairs them!
At the set start level, one should be able to get all the masts without
taking any notice of the enemy plane.
Once you get the feel of what speed to go,--
Too long airbourne may lead to stopping to refuel, and more time loss..
(Fuel is blue bar on cockpit right.)
Note..
You automatically refuel if you land on the runway succesfully.
Which means not too fast or steep. Aim for about 120-140 speed as displayed
on the bottom left of HUD area. You will stall gradually below 120.
The relative map 2 can make it much easier to line up with the runway.
Note that the main runway ( with lines on and lying north/south) is the only
fully fuctional one.
To make a harder level, the time between enemy re-appearance gets shorter.
Depending on how fast you can get around the targets, you will then HAVE to
start shooting the enemy down. This sets back the underground rebuilding
and puts the enemy plane off screen for a good time so that you can get on
with demolishing masts.
However -it can take quite a long time to track down the plane...
And it may go off limit just before you get there, when it will accelerate
very fast away into it's own territory....
I tend to use the main map 1 to check if it's heading 'out' and then the
relative radar map 2 to track it down and when trying to get behind
and/ or fire the rocket.
And you will need to refuel as the flight time gets much higher.
It's at this point I have not time to balance up all the factors to see if
they work properly.
Perhaps I'll find another way to get connected to the internet, and can
organise this program better.
But it's more likely to be with a PC of some sort, if I can stand it,
and it will probably be goodbye to the Amiga.......
In any case, see if you can have some fun with the prog. I personally like
the high speed chase after the enemy plane when it's low or going through
the mountain areas. Or just racing about at full speed. A simple mind...
.......................
Complete controls
joystick flight control
fire button missile
A add power
S less power
(note there is inertia, speed follows later- power is red line on right)
1 normal map
2 relative map -enemy and airstrip
3 relative map -targets
P pause
Z zoom map 3
X unzoom map 3
R reset to runway
N reduce time between enemy plane visits
M more time between enemy visits
4 move enemy plane directly before view.
8 make new enemy come from 'outside'
< and > experiment to move the scenery further out and in
K strange 'set colour in program' idea (one colour resets back in prog)
D toggles distant "spots on/off
C stop program with sound volume OFF !!#$#$
L this will produce a file selector to get a different landscape
and may be useful at some stage...?
------------------------
-----------------------